
// 指定允许其他域名访问
//header('Access-Control-Allow-Origin:*');
// 响应类型
//header('Access-Control-Allow-Methods:POST');
// 响应头设置
//header('Access-Control-Allow-Headers:x-requested-with,content-type');

var http = require("http");

http.createServer(function (request, response) {
	response.writeHead(200, { "Content-Type": "text/plain" });
	response.write('this is the content of response.write');
	response.end('this is the content of response.end');
}
).listen(8888);

console.log("http-server has run in URL: http://127.0.0.1:8888");